package com.feng.cloud.system.controller;

import com.feng.cloud.common.response.RestResponse;
import com.feng.cloud.common.response.TableResultResponse;
import com.feng.cloud.system.entity.SystemUser;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Map;

/**
 * @ClassName IUserController
 * @Description TODO
 * @Author Better Feng
 * @Date 2019/12/20 17:10
 * @Version 1.0
 **/
@RequestMapping("user")
public interface IUserController {

    /**
     * 列表查询
     * @param params Map
     * @return TableResultResponse
     */
    @GetMapping("page")
    TableResultResponse<SystemUser> selectPage(@RequestParam Map<String, Object> params);

    /**
     * 新增用户
     * @param user SystemUser
     * @return RestResponse
     */
    @PostMapping
    RestResponse<SystemUser> add(@Valid SystemUser user);

    /**
     * 修改用户
     * @param user SystemUser
     * @return RestResponse
     */
    @PutMapping
    RestResponse<SystemUser> update(@Valid SystemUser user);

    /**
     * 删除用户
     * @param userIds ids
     * @return RestResponse
     */
    @DeleteMapping("/{userIds}")
    RestResponse<Void> update(@NotBlank(message = "{required}") @PathVariable String userIds);

    /**
     * 修改用户信息
     * @param user SystemUser
     * @return RestResponse<SystemUser>
     */
    @PutMapping("profile")
    RestResponse<SystemUser> updateUserProfileById(@Valid SystemUser user);
}
